package com.bdqn.hospital.controller;

import com.bdqn.hospital.pojo.DrugBatch;
import com.bdqn.hospital.service.DrugBatchService;
import com.bdqn.hospital.service.impl.DrugBatchServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @version : 1.0
 * @Author :guogd
 * @createTime: 2023/03/01 14:34
 * @Description: com.bdqn.hospital.controller
 */
@Controller
@RequestMapping("drugbatch")
public class DrugBatchController {
    /**
     * 药品批次Controller
     */
    @Autowired
    private DrugBatchServiceImpl batchService;

    @RequestMapping("getDrugBatch")
    @ResponseBody
    public DrugBatch getDrugBatch(@RequestParam("name") String name){
        DrugBatch drug = batchService.getDrug(name);
        return drug;
    }

    @RequestMapping("isCount")
    @ResponseBody
    public Integer isCount(@RequestParam("id") Integer id,@RequestParam("count") Integer count){
        return batchService.isConut(id,count);
    }
}
